<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>使用object中的特性去掉数组中的重复项</title>
</head>
<body>
<script type="text/javascript">

	var arr = [1,5,2,8,2,6,1,8,9,2,4,8,1];

	var obj = new Object();

	for(var key in arr){
		obj[arr[key]] = arr[key];
	}
	var arr = [];
	for(var key in obj){
		arr.push(obj[key]);
	}

	console.log(arr);
	

</script>
</body>
</html>